<!--vue模板-->
<template>
  <div>产品详情</div>
</template>

<!--vue 组件选项定义-->
<script setup>
import { ref, onBeforeMount } from "vue";
import { useRoute } from "vue-router";
//路由信息
const route = useRoute();

const productId = ref(0);

async function init(id) {
  console.log("根据id=" + id);
}

onBeforeMount(() => {
  productId.value = route.query.id;
  init(route.query.id);
});
</script>

<!--vue样式 scoped当前样式只适用于当前组件-->
<style scoped></style>
